﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MailMarketing.Models.Entity.Cliente>>" %>
<%@ Import Namespace="MailMarketing.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Lista de Clientes</h2>

    <table>
        <tr>
            <th></th>
            <th>
                Nome
            </th>
            <th>
                Endereço
            </th>
            <th>
                Núm.
            </th>
            <th>
                Cep
            </th>
            <th>
                Tel.
            </th>
            <th>
                Fax
            </th>
            <th>
                Email
            </th>
            <th>
                Nascimento
            </th>
            <th>
                Sexo
            </th>
            <th>
                Observação
            </th>
            <th>
                Cidade
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%: Html.ActionLink("Editar", "Editar", new { id=item.ClienteId }) %> |
                <%: Html.ActionLink("Detalhes", "Detalhes", new { id=item.ClienteId })%> |
                <%: Html.ActionLink("Excluir", "Excluir", new { id=item.ClienteId })%>
            </td>
            <td>
                <%: Html.Truncate(item.Nome,10) %>
            </td>
            <td>
                <%: Html.Truncate( item.Endereco,10) %>
            </td>
            <td>
                <%: item.Numero %>
            </td>
            <td>
                <%: item.Cep %>
            </td>
            <td>
                <%: item.Telefone %>
            </td>
            <td>
                <%: item.Fax %>
            </td>
            <td>
                <%: Html.Truncate( item.Email,10) %>
            </td>
            <td>
                <%: String.Format("{0:dd/MM/yyyy}", item.DataNascimento) %>
            </td>
            <td>
                <%: Html.formataSexo(item.Sexo) %>
            </td>
            <td>
                <%: Html.Truncate(item.Observacao,5) %>
            </td>
            <td>
                <%: Html.Truncate(item.Cidade.Nome,10) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Novo Cliente", "Novo") %>
    </p>

</asp:Content>

